<?php


namespace App\service;


class ReturnService
{



    

    //成功的返回状态
    public static function successReturn($msg = '成功' , $data = [],$code = 200)
    {
        return response()->json([
            'code' => $code,
            'msg' => $msg,
            'data' => $data
        ])->setEncodingOptions(JSON_UNESCAPED_UNICODE);
    }

    //失败的返回状态
    public static function failedReturn($msg = '失败',$code = 500)
    {
        return response()->json([
            'code' => $code,
            'msg' => $msg,
        ])->setEncodingOptions(JSON_UNESCAPED_UNICODE);
    }
}
